fix: ignore empty operation_mode to prevent ServiceValidationError#768
Open
songjiao wants to merge 4 commits intowuwentao:masterfrom
Open
fix: ignore empty operation_mode to prevent ServiceValidationError#768songjiao wants to merge 4 commits intowuwentao:masterfrom
songjiao wants to merge 4 commits intowuwentao:masterfrom
Conversation
When setting water heater temperature via HA UI, an empty operation_mode parameter may be passed, causing HA core to raise ServiceValidationError before reaching the custom component's validation logic. This fix adds two layers of protection in MideaCDWaterHeater: 1. async_handle_set_operation_mode: intercepts before HA core validation 2. set_operation_mode: additional safety layer for sync calls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When setting temperature via automation, the midea-local library includes current power state in the command message. If power is incorrectly read as False (due to sync delay or device reporting issues), setting temperature will turn off the device. This fix adds a set_temperature override in MideaCDWaterHeater that: 1. Checks current power state before setting temperature 2. Forces power on if device appears to be off 3. Then sets the target temperature Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Without ON_OFF flag, HA blocks water_heater.turn_on service call. This is needed for automations that detect power-off and auto-restart. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When setting water heater temperature via HA UI, an empty operation_mode parameter may be passed, causing HA core to raise ServiceValidationError before reaching the custom component's validation logic.
This fix adds two layers of protection in MideaCDWaterHeater:
PR Description
Reason & Detail
Related issue
fix #X